import { createStore, createLogger } from 'vuex'
import state from './state'
import mutations from './mutations'
import * as getters from './getters'
import * as actions from './actions'

const debug = process.env.NODE_ENV !== 'production' // 开发环境
export default createStore({
  state,
  mutations,
  actions,
  getters,
  strict: debug, // 开启严格模式
  plugins: debug ? [createLogger()] : [] // 开发环境下使用createLogger插件 线上模式不用
  // modules 多个stort使用

})
